package com.project_doctor.controller;

import com.project_doctor.pojo.Team;
import com.project_doctor.service.TeamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/team")
public class TeamController {

    @Autowired
    private TeamService teamService;

    @GetMapping("/getAllTeam")
    public ResponseEntity<?> getAllTeam(){
        List<Team> teams = teamService.list();
        return ResponseEntity.ok(teams);
    }
}
